﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Models.Login.LoginModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户登录</title>
    <script src='<%=Url.Content("~/Scripts/jquery-1.4.2.js")%>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/jquery.validate.pack.js")%>' type="text/javascript"></script>
    <script src='<%=Url.Content("~/Scripts/MicrosoftMvcJQueryValidation.js")%>' type="text/javascript"></script>
    <link href='~/Content/comm.css' rel="stylesheet" type="text/css" />
    <link href="~/Content/login.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="body">
        <%Html.EnableClientValidation(); %>
        <%Html.BeginForm(); %>
        <div class='divMain'>
            <table>
                <tr>
                    <td id='tdhider' colspan='3'>
                    </td>
                </tr>
                <%if (ViewData.ModelState["LoginError"] != null)
                  { %>
                <tr>
                    <td class="tdleft">
                    </td>
                    <td colspan='2' class='tdError'>
                        <%=Html.ValidationMessage("LoginError") %>
                    </td>
                </tr>
                <%} %>
                <tr>
                    <td class="tdleft">
                    </td>
                    <td colspan='2' class='tdError'>
                        <%=Html.ValidationMessageFor(p => p.LoginName, "", new { @class = "validation" })%>
                    </td>
                </tr>
                <tr>
                    <td align="right" class='tdleft'>
                        用户名:
                    </td>
                    <td colspan='2' align="left">
                        <input type="text" name="LoginName" id="LoginName" tabindex="1" class='txt width200'
                            value='<%=Model.LoginName %>' />
                    </td>
                </tr>
                <tr>
                    <td class="tdleft">
                    </td>
                    <td colspan='2' class='tdError'>
                        <%=Html.ValidationMessageFor(p => p.LoginPwd, "", new{@class="validation" })%>
                    </td>
                </tr>
                <tr>
                    <td align="right" class='tdleft'>
                        密码:
                    </td>
                    <td colspan='2' align="left">
                        <input type="password" name="LoginPwd" id="LoginPwd" class='txt width200' tabindex="2" />
                    </td>
                </tr>
                <tr>
                    <td class="tdleft">
                    </td>
                    <td colspan='2' class='tdError'>
                        <%=Html.ValidationMessageFor(p=>p.CheckCode,"",new {@class="validation"})%>
                    </td>
                </tr>
                <%=Html.HiddenFor(p => p.Num)%>
                <%if (Model.Show == true)
                  {%>
                <%Model.Show = true; %>
                <%=Html.HiddenFor(p => p.Show)%>
                <tr>
                    <td align="right" class='tdleft'>
                        验证码:
                    </td>
                    <td colspan='2' align="left">
                        <input type="text" name="CheckCode" id="CheckCode" class='txt width130' tabindex="3" />
                        <img src='<%=Url.Content("~/Login/CheckCode/Login") %>' class="checkimg" onclick="this.src='<%=Url.Content("~/Login/CheckCode/Login") %>?'+ Math.random()"
                            alt="点击换一张" />
                    </td>
                </tr>
                <%} %>
                <tr>
                    <td colspan='3'>
                        <table width="100%" height="50px;" cellpadding="0" cellspacing="0" class='tabRatio'>
                            <tr>
                                <% int i = 0; %>
                                <% foreach (var ratio in Model.Ratios) %>
                                <% { %>
                                <td>
                                    <label>
                                        <%=Html.RadioButtonFor(p => p.Ratio, ratio.Key, i == 0 ? (object)new { @Checked = "checked", tabindex = "4", name = "ratio" } : new { tabindex = "4", name = "ratio" })%>
                                        <%=ratio.Value%>模式
                                    </label>
                                </td>
                                <%  i = 1;
                                   } %>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td class='tdleft'>
                    </td>
                    <td id='td_FindPwd' align="center">
                     <input type="button"  tabindex="2" onclick="ShowDiv()"  id="test"  style="background-image:url('../../Content/images/Jianpan.jpg') ; height:20px; width:20px;  border:none" /><br />
                        <%=Html.ActionLink("忘记密码?", "FindPwd", new { }, new { @class = "linkBtn" })%>
                       
                    </td>
                    <td align="left">
                        <%
                            var str = Model.WinModels.OrderBy(p => p.Value).Select(p => string.Format(@"<input type='submit' name='WinModel:{0}' tabindex='7' class='login_btn'
                                value='' />", p.Key, p.Value)).FirstOrDefault();
                        %>
                        <%=str %>
                    </td>
                </tr>
            </table>
            <div id="MyKey" style="display: none; position: absolute; left: 0px; top: 0px; width: 360px;
        height: 139px; border-right: #0066cc 1px solid; border-top: #0066cc 1px solid;
        border-left: #0066cc 1px solid; border-bottom: #0066cc none; margin-top:230px; margin-left:900px;"   >
        <table width="100%" height="139px" cellpadding="0" cellspacing="0" border="0" >
            <tr style="background-color: #66ccff;">
                <td align="left" style="height: 30px;">
                   请选择密码
                </td>
                <td align="left" id="LoginPwd_UpperLowerStatus" style="color: white">
                    &nbsp;[小写]
                </td>
                <td align="right">
                    <input type="button" style="  background-image:url('../../Content/images/Close.gif') ; height:15px; width:8px;  border:none"   onclick="DisDiv()"/>&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="3" style="width: 136px; height: 109px ; ">
                    <img src="../../Content/images/KeyBoard.gif" alt="" width="360" height="109" usemap="#Map_MyKey" />
                    <map name="Map_MyKey" id="Map_MyKey">
                        <area shape="rect" coords="1,1,23,20" title="`/~" alt="~" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('`~', 'LoginPwd');" />
                        <area shape="rect" coords="25,1,48,20" title="1/!" alt="~" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('1!', 'LoginPwd');" />
                        <area shape="rect" coords="49,1,72,20" title="2/@" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('2@', 'LoginPwd');" />
                        <area shape="rect" coords="73,1,97,20" title="3/#" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('3#', 'LoginPwd');" />
                        <area shape="rect" coords="100,1,122,20" title="4/$" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('4$', 'LoginPwd');" />
                        <area shape="rect" coords="126,1,147,20" title="5/%" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('5%', 'LoginPwd');" />
                        <area shape="rect" coords="151,1,172,20" title="6/^" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('6^', 'LoginPwd');" />
                        <area shape="rect" coords="175,1,196,20" title="7/&" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('7&', 'LoginPwd');" />
                        <area shape="rect" coords="199,1,222,20" title="8/*" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('8*', 'LoginPwd');" />
                        <area shape="rect" coords="225,1,247,20" title="9/(" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('9(', 'LoginPwd');" />
                        <area shape="rect" coords="249,1,271,20" title="0/)" href="#" alt="~" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('0)', 'LoginPwd');" />
                        <area shape="rect" coords="275,1,296,20" title="-/_" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('-_', 'LoginPwd');" />
                        <area shape="rect" coords="300,1,323,20" title="=/+" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('=+', 'LoginPwd');" />
                        <area shape="rect" coords="325,1,358,20" title="退格/双击将全部清除" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('Backspace', 'LoginPwd');"
                            ondblclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnClear('LoginPwd');" />
                        <area shape="rect" coords="38,22,60,43" title="Q" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('qQ', 'LoginPwd');" />
                        <area shape="rect" coords="62,22,84,43" title="W" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('wW', 'LoginPwd');" />
                        <area shape="rect" coords="87,22,110,43" title="E" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('eE', 'LoginPwd');" />
                        <area shape="rect" coords="112,22,135,43" title="R" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('rR', 'LoginPwd');" />
                        <area shape="rect" coords="137,22,160,43" title="T" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('tT', 'LoginPwd');" />
                        <area shape="rect" coords="162,22,184,43" title="Y" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('yY', 'LoginPwd');" />
                        <area shape="rect" coords="187,22,210,43" title="U" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('uU', 'LoginPwd');" />
                        <area shape="rect" coords="212,22,236,43" title="I" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('iI', 'LoginPwd');" />
                        <area shape="rect" coords="237,22,260,42" title="O" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('oO', 'LoginPwd');" />
                        <area shape="rect" coords="262,22,284,42" title="P" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('pP', 'LoginPwd');" />
                        <area shape="rect" coords="286,22,309,42" title="[/{" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('[{', 'LoginPwd');" />
                        <area shape="rect" coords="311,22,334,42" title="]/}" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress(']}', 'LoginPwd');" />
                        <area shape="rect" coords="336,22,358,42" title="\/|" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('\|', 'LoginPwd');" />
                        <area shape="rect" coords="3,47,40,63" title="大小写切换" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('CapsLock', 'LoginPwd');" />
                        <area shape="rect" coords="43,47,65,63" title="A" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('aA', 'LoginPwd');" />
                        <area shape="rect" coords="70,45,88,63" title="S" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('sS', 'LoginPwd');" />
                        <area shape="rect" coords="96,46,115,63" title="D" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('dD', 'LoginPwd');" />
                        <area shape="rect" coords="119,45,140,63" title="F" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('fF', 'LoginPwd');" />
                        <area shape="rect" coords="144,45,165,64" title="G" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('gG', 'LoginPwd');" />
                        <area shape="rect" coords="169,45,190,64" title="H" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('hH', 'LoginPwd');" />
                        <area shape="rect" coords="194,45,215,64" title="J" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('jJ', 'LoginPwd');" />
                        <area shape="rect" coords="219,45,241,64" title="K" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('kK', 'LoginPwd');" />
                        <area shape="rect" coords="244,45,265,64" title="L" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('lL', 'LoginPwd');" />
                        <area shape="rect" coords="269,45,291,64" title=";/:" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress(';:', 'LoginPwd');" />
                        <area shape="rect" coords="294,45,315,63" title="'/”" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('Quotes', 'LoginPwd');" />
                        <area shape="rect" coords="319,45,358,64" title="回车，确定" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('Enter', 'LoginPwd');" />
                        <area shape="rect" coords="2,68,54,85" title="上档键" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('Shift', 'LoginPwd');" />
                        <area shape="rect" coords="57,67,78,85" title="Z" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('zZ', 'LoginPwd');" />
                        <area shape="rect" coords="82,67,103,85" title="X" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('xX', 'LoginPwd');" />
                        <area shape="rect" coords="107,67,128,86" title="C" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('cC', 'LoginPwd');" />
                        <area shape="rect" coords="132,67,154,86" title="V" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('vV', 'LoginPwd');" />
                        <area shape="rect" coords="157,67,178,86" title="B" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('bB', 'LoginPwd');" />
                        <area shape="rect" coords="182,67,202,86" title="N" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('nN', 'LoginPwd');" />
                        <area shape="rect" coords="208,68,228,86" title="M" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('mM', 'LoginPwd');" />
                        <area shape="rect" coords="232,67,252,86" title=",/<" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress(',<', 'LoginPwd');" />
                        <area shape="rect" coords="257,67,278,86" title="./>" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('.>', 'LoginPwd');" />
                        <area shape="rect" coords="282,67,302,85" title="//?" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('/?', 'LoginPwd');" />
                        <area shape="rect" coords="307,67,357,84" title="上档键" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('Shift', 'LoginPwd');" />
                        <area shape="rect" coords="114,89,246,107" title="空格" href="#" onclick="ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress('  ', 'LoginPwd');" />
                    </map>
                </td>
            </tr>
        </table>
    </div>
        </div>
        <div style="display: none;" />
        <%=Html.SerializableFor(p=>p.Ratios) %>
        <%=Html.SerializableFor(p=>p.WinModels) %>
        <% Html.EndForm(); %>
        <span>style="display:none;">
            <%=ViewData["LoginResult"]??"" %>
        </span>
    </div>
    
     <script type="text/javascript">

         /*
         带软键盘的密码输入控件
         作者：shove
         时间：2007-8-24
         */

         var ShoveWebUI_ShovePasswordTextBox_UpperLowerState = "lower";
         var ShoveWebUI_ShovePasswordTextBox_MouseAtObject = null;

         function ShoveWebUI_ShovePasswordTextBox_OnClick(sender) {
             var objDiv = document.getElementById(sender.id + "_DivKeyBoard");
             if (!objDiv) {
                 return;
             }

             var pos = ShoveWebUI_ShovePasswordTextBox_GetControlPosAtWindow(sender);
             objDiv.style.left = pos.left;
             objDiv.style.top = pos.bottom;

             objDiv.style.display = "";
             var objUpperLowerStatus = document.getElementById(sender.id + "_UpperLowerStatus");
             if (objUpperLowerStatus) {
                 objUpperLowerStatus.innerText = (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") ? "[小写]" : "[大写]";
             }
         }

         function ShoveWebUI_ShovePasswordTextBox_OnBlur(sender) {
             var objDiv = document.getElementById(sender.id + "_DivKeyBoard");
             if (!objDiv) {
                 return;
             }

             if (ShoveWebUI_ShovePasswordTextBox_MouseAtObject != objDiv) {
                 objDiv.style.display = "none";
             }
         }

         function ShoveWebUI_ShovePasswordInputKeyBoard_OnKeyPress(Key, objTextBox_id) {

             var objTextBox = document.getElementById(objTextBox_id);
             if (!objTextBox) {
                 return;
             }

             objTextBox.focus();

             var objUpperLowerStatus = document.getElementById(objTextBox_id + "_UpperLowerStatus");

             if (!objUpperLowerStatus) {
                 return;
             }

             var objDiv = document.getElementById("MyKey");

             if (!objDiv) {
                 return;
             }

             var KeyChar = Key;

             if (Key == "Backspace") {
                 if (objTextBox.value != "") {
                     objTextBox.value = objTextBox.value.substring(0, objTextBox.value.length - 1);
                 }
                 return;
             }
             else if (Key == "CapsLock") {
                 ShoveWebUI_ShovePasswordTextBox_UpperLowerState = (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") ? "upper" : "lower";
                 objUpperLowerStatus.innerText = (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") ? "[小写]" : "[大写]";
                 return;
             }
             else if (Key == "Quotes") {
                 KeyChar = "'" + '"';
             }
             else if (Key == "Enter") {
                 objDiv.style.display = "none";
                 objTextBox.focus();
                 return;
             }
             else if (Key == "Shift") {
                 ShoveWebUI_ShovePasswordTextBox_UpperLowerState = (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") ? "upper" : "lower";
                 objUpperLowerStatus.innerText = (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") ? "[小写]" : "[大写]";
                 return;
             }

             if (KeyChar.length != 2) {
                 return;
             }

             if (ShoveWebUI_ShovePasswordTextBox_UpperLowerState == "lower") {
                 objTextBox.value += KeyChar.substring(0, 1);
             }
             else {
                 objTextBox.value += KeyChar.substring(1, 2);
             }
         }
         //清除值
         function ShoveWebUI_ShovePasswordInputKeyBoard_OnClear(objTextBox_id) {
             var objTextBox = document.getElementById(objTextBox_id);
             if (!objTextBox) {
                 return;
             }

             objTextBox.value = "";
         }
         //显示软键盘
         function ShowDiv() {
             document.getElementById("MyKey").style.display = "block";
         }
         //关闭小键盘
         function DisDiv() {
             document.getElementById("MyKey").style.display = "none";
         }
         function ShoveWebUI_ShovePasswordInputKeyBoard_OnClose(objDiv_id, objTextBox_id) {
             var objTextBox = document.getElementById(objTextBox_id);
             if (!objTextBox) {
                 return;
             }

             var objDiv = document.getElementById(objTextBox_id + "_DivKeyBoard");
             if (!objDiv) {
                 return;
             }

             objDiv.style.display = "none";
             objTextBox.focus();
         }

         function ShoveWebUI_ShovePasswordTextBox_SetMouseAtObject(sender, value) {
             if (value) {
                 ShoveWebUI_ShovePasswordTextBox_MouseAtObject = sender;
             }
             else {
                 ShoveWebUI_ShovePasswordTextBox_MouseAtObject = null;
             }
         }

         function ShoveWebUI_ShovePasswordTextBox_GetControlPosAtWindow(sender) {
             var oRect = sender.getBoundingClientRect();

             var oLTRB =
    {
        "left": oRect.left + document.body.scrollLeft + document.documentElement.scrollLeft,
        "top": oRect.top + document.body.scrollTop + document.documentElement.scrollTop,
        "right": oRect.right + document.body.scrollTop + document.documentElement.scrollTop,
        "bottom": oRect.bottom + document.body.scrollTop + document.documentElement.scrollTop
    };

             return oLTRB;
         }

     </script>
</body>
</html>
